<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="../common/tag.jsp"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>在线考试</title>
<meta name="Keywords"	content="试卷，在线考试">
<meta name="description" content="试卷，在线考试">
<%@ include file="../common/common.jsp"%>
<script src="js/public/article/article.js"></script>
</head>
<body>
	<jsp:include page="/public/top.jsp"></jsp:include>
	<div class="step-detail" >
		<span>
			<a href="public/index">首页</a>>>
			<a href="public/article">试卷列表</a>
		</span>
	</div>
	<div class="yc_container" style="margin-bottom: 15px;">
		<div class="sys-list-left" >
				<ul>
					<c:forEach items="${examPaperQnsVos}" var="examPaperQnsVo">
						<li>
							<%-- <div style="width: 60px;float: left;margin-top: 8px;">
									<img alt="${paperModel.paperName }" src="images/paper.png"  style="width: 50px;height: 50px;"/>
							</div> --%>
							<div class="sys-list-detail">
								 <div class="sys-list-detail-title">
									 ${examPaperQnsVo.qsTitle }
								</div>
								<%-- <div>
									<span style="color: #5CB85C;">总分:${paperModel.totalScore }</span>
								     <span style="color: #5CB85C;">考试时间:${paperModel.examDate }</span>&nbsp;&nbsp;
									<a href="#" target="_blank">
										<span style="font-size: 12px;float: right;color: #5CB85C;">开始考试</span>
									</a>
								     <div class="sys-list-detail-desc">${fn:substring(paperModel.paperDesc, 0, 100)}</div>
								</div> --%>
							</div>
						</li>
					</c:forEach>
			   </ul>
		</div>
		<div class="pagination-bar bar-width720">
			<div class="pagination-bar-left"><span>共${page.totalCount}条记录&nbsp;${page.totalPageCount}页</span></div>
			<div class="pagination-bar-right">
					<span><a href="public/bookList?pageNow=1">首页</a></span>
					<c:choose>
						<c:when test="${page.pageNow -1 >0}">
							<span><a href="public/bookList?pageNow=${page.pageNow-1}">&lt;</a></span>
						</c:when>
					</c:choose>
					<%-- 计算页码列表的开始和结束位置，即两个变量begin和end --%>
					<c:choose>
						<c:when test="${page.totalPageCount <=2}">
								<c:set var="begin" value="1"></c:set>
								<c:set var="end" value="${page.totalPageCount }"></c:set>
						 </c:when>
						 <c:otherwise>
								<c:set var="begin" value="${page.pageNow-2 }"/>
	 							<c:set var="end" value="${page.pageNow + 2}"/>
	 							<c:if test="${begin <=1 }">
									<c:set var="begin" value="1"/>
	 							</c:if>
	 							<c:if test="${end>=page.totalPageCount }">
	 								 <c:set var="end" value="${page.totalPageCount }"/>
	 							</c:if>
							</c:otherwise>
						</c:choose>
						<%--页码 --%>
						<c:forEach begin="${begin }" end="${end}" var="pageIndex">
								<c:choose>
									<c:when test="${page.pageNow==pageIndex}">
										<span><a href="javascript:void(0);"style="float: left; background: #EAEAEA;">${pageIndex }</a></span>
									</c:when>
									<c:otherwise>
											<span><a href="public/bookList?pageNow=${pageIndex}" target="_self">${pageIndex }</a></span>
									</c:otherwise>
								</c:choose>
						</c:forEach>
						<%-- 显示当前页后面点点点 --%>
						<c:if test="${end< page.totalPageCount}">
								<span><a  href="javascript:void(0);">...</ a></span>
						</c:if>
						<c:choose>
							<c:when test="${page.pageNow <page.totalPageCount}">
								<span><a href="public/bookList?pageNow=${page.pageNow+1 }" target="_self">&gt;</a></span>
							 </c:when>
						</c:choose>
						<span>
							<a href="public/bookList?pageNow=${page.totalPageCount}">末页</a>
						</span>
					</div>
				</div>
		<%-- <div class="page" style="margin-left: 0;width: 710px;">
				<span><a href="public/article/articleList/${categoryId}?pageNow=1">首页</a></span>
				<c:choose>
					<c:when test="${page.pageNow -1 >0}">
						     <span><a href="public/article/articleList/${categoryId}?pageNow=${page.pageNow-1}">上一页</a></span>
					</c:when>
				</c:choose>
				<c:forEach begin="1" end="${page.totalPageCount}" var="pageIndex">
						<c:choose>
						        <c:when test="${page.pageNow==pageIndex}">
						               <span><a href="javascript:void(0);" style="float: left;background:#EAEAEA; ">${pageIndex }</a></span>
						          </c:when>
							       <c:otherwise>
							            <span><a href="public/article/articleList/${categoryId}?pageNow=${pageIndex}" target="_self">${pageIndex }</a></span>
							      </c:otherwise>
						   </c:choose>
					</c:forEach>
					<c:choose>
						   <c:when test="${page.pageNow <page.totalPageCount}">
						         <span><a href="public/article/articleList/${categoryId}?pageNow=${page.pageNow+1 }" target="_self">下一页</a></span>
						   </c:when>
					</c:choose>
					<span><a href="public/article/articleList/${categoryId}?pageNow=${page.totalPageCount}">末页</a></span>
			</div> --%>
    </div>
	<jsp:include page="/public/bottom.jsp"></jsp:include>
</body>
</html>
